<div class="bh-ly-yw-gong">
           <h4 class="bh-ly-yw-shang">供应商信息</h4>
           <div class="bh-ly-yw-gongying">
           		<table>
                	<tr>
                    	<td width="78" align="center" valign="top">公司名称：</td>
                        <td width="144"><?php echo CHtml::value($model, 'info.name')?></td>
                    </tr>
                    <tr>
                    	<td align="center">真实姓名：</td>
                        <td><?php echo CHtml::value($model, 'profile.realname')?></td>
                    </tr>
                    <tr>
                    	<td align="center">认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;证：</td>
                        <td><?php if ($model->status == 'ST_PASSED'):?><img src="<?php echo Yii::app()->baseUrl;?>/images/yw-ly-renzheng.jpg"/><?php endif;?></td>
                    </tr>
                    <tr>
                    	<td align="center">经营模式：</td>
                        <td><?php echo CHtml::value($model, 'info.category.category_name')?></td>
                    </tr>
                    <tr>
                    	<td align="center">公司地址：</td>
                        <td><?php echo CHtml::value($model, 'info.address')?></td>
                    </tr>
                    <tr>
                    	<td align="center">职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;务：</td>
                        <td><?php echo CHtml::value($model, 'profile.position')?></td>
                    </tr>
                    <tr>
                    	<td align="center">公司电话：</td>
                        <td><?php echo CHtml::value($model, 'info.tel')?></td>
                    </tr>
                    <?php 
                    	$adminUser = Yii::app()->adminUser;
                    	if (!empty($adminUser->id) && $adminUser->role == AdminUser::ROLE_DEALER):
                    ?>
                    <tr>
                    	<td></td>
                        <td>
                        	<?php 
                        		$related = AgentRelated::model()->related($adminUser->id, $model->id);
                        		if (is_object($related) && CHtml::value($related, 'status') != 'ST_PASSED') echo '已申请代理';
                        		else if (CHtml::value($related, 'status') == 'ST_PASSED') echo '已代理';
                        		else echo CHtml::button('申请代理', array(
                        			'class'=>'bh-ly-ydchaxun-jj bh-href',
                        			'href'=> Yii::app()->createUrl('shop/index/applyAgent',array('uid'=>$model->id))
                        		))
                        	?>
                        </td>
                    </tr>
                    <?php endif;?>
                </table>
           </div>
        </div>